package ma.mindware.mpm.technicalservice.db;

import java.util.ArrayList;

import jpmapper.core.Transaction;
import jpmapper.exceptions.JPMapperException;
import ma.mindware.met.core.technicalservice.DBService;
import ma.mindware.met.core.technicalservice.TechnicalServiceException;
import ma.mindware.mpm.domain.tutorial.Quote;

public class QuoteDBService extends DBService {
	

	
	public QuoteDBService(Object[] parameters) throws TechnicalServiceException {
		super(parameters);
		// TODO Auto-generated constructor stub
	}
	
	public ArrayList<Quote> getQuoteList(){
		
		ArrayList<Quote> quoteList=new ArrayList<Quote>() ;
		Transaction transaction;
		try {
			transaction = this.jpmapperFacade.getNewTransaction();
			transaction.begin();
			quoteList=transaction.getAll(new Quote());
			

			transaction.end();
			
		} catch (JPMapperException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		return quoteList ;
	}

	
}
